<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>路口信控数智融合AI决策系统 - 登录</title>
    <link rel="stylesheet" href="./layui/css/layui.css">
    <style>
        body {
            background: linear-gradient(120deg, #e0f7fa, #bbdefb);
            height: 100vh;
            margin: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            font-family: "微软雅黑", Arial, sans-serif;
        }

        .login-container {
            width: 100%;
            max-width: 400px;
            padding: 20px;
        }

        .login-card {
            background: white;
            border-radius: 8px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
            padding: 30px;
            text-align: center;
        }

        .system-title {
            margin-bottom: 30px;
        }

        .system-title h1 {
            color: #1e88e5;
            font-size: 24px;
            margin: 10px 0;
        }

        .logo {
            width: 60px;
            height: 60px;
            background: #1e88e5;
            border-radius: 50%;
            margin: 0 auto;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 24px;
            font-weight: bold;
        }

        .login-form {
            text-align: left;
        }

        .login-form-item {
            margin-bottom: 20px;
        }

        .login-form-item label {
            display: block;
            margin-bottom: 5px;
            color: #333;
            font-weight: 500;
        }

        .input-group {
            position: relative;
        }

        .input-group .layui-icon {
            position: absolute;
            left: 10px;
            top: 50%;
            transform: translateY(-50%);
            color: #999;
        }

        .input-group input {
            padding-left: 35px;
        }

        .login-btn {
            margin-top: 10px;
        }
    </style>
</head>

<body>
    <div class="login-container">
        <div class="login-card">
            <div class="system-title">
                <div class="logo">AI</div>
                <h1>路口信控数智融合AI决策系统V1.0</h1>
            </div>

            <form class="layui-form login-form">
                <div class="login-form-item">
                    <label for="username">用户名</label>
                    <div class="input-group">
                        <i class="layui-icon layui-icon-username"></i>
                        <input type="text" id="username" name="username" required lay-verify="required"
                            placeholder="请输入用户名" autocomplete="off" class="layui-input" value="admin">
                    </div>
                </div>

                <div class="login-form-item">
                    <label for="password">密码</label>
                    <div class="input-group">
                        <i class="layui-icon layui-icon-password"></i>
                        <input type="password" id="password" name="password" required lay-verify="required"
                            placeholder="请输入密码" autocomplete="off" class="layui-input" value="123456">
                    </div>
                </div>

                <div class="login-form-item login-btn">
                    <button class="layui-btn layui-btn-fluid" lay-submit lay-filter="login">登录</button>
                </div>
            </form>
        </div>
    </div>

    <script src="./layui/layui.js"></script>
    <script>
        layui.use(['form'], function () {
            var form = layui.form;

            // 监听登录提交
            form.on('submit(login)', function (data) {
                // 显示加载提示
                // var loading = layer.load(1, {
                //     shade: [0.1, '#fff']
                // });

                // 模拟登录过程
                // layer.close(loading);

                layer.msg('登录成功', {
                    icon: 1,
                    time: 30000
                }, function () {
                    // 登录成功，跳转到系统主界面
                    // window.location.href = 'index.html';
                });

                // 阻止表单默认提交
                return false;
            });

            // 页面加载完成后自动聚焦到用户名输入框
            document.getElementById('username').focus();
        });
    </script>
</body>

</html>